package com.young.mybatis.v2.sqlsource;

import com.young.mybatis.v2.sqlsource.iface.SqlSource;
import com.young.mybatis.v2.sqlsource.model.BoundSql;
import com.young.mybatis.v2.sqlsource.model.ParameterMapping;

import java.util.List;

/**
 * 描述:
 *
 * @author BluceYoung
 * @create 2020-07-04 9:51
 * B站：TeacherYoung凌风
 * www.teacheryoung.com
 */
public class StaticSqlSource implements SqlSource {

    private String sql;
    private List<ParameterMapping> parameterMappings;

    public StaticSqlSource(String sql, List<ParameterMapping> parameterMappings) {
        this.sql = sql;
        this.parameterMappings = parameterMappings;
    }

    public BoundSql getBoundSql(Object param) {
        return new BoundSql(sql,parameterMappings);
    }
}
